home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWPart / Include / FWLnkDst.h < prev    next >
Encoding:
Text File  |  1996-08-16  |  4.1 KB  |  136 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWLnkDst.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWLNKDST_H
  11. #define FWLNKDST_H
  12.  
  13. #ifndef FWLINK_H
  14. #include "FWLink.h"
  15. #endif
  16.  
  17. #ifndef FWSTDDEF_H
  18. #include "FWStdDef.h"
  19. #endif
  20.  
  21. #ifndef FWRUNTYP_H
  22. #include "FWRunTyp.h"
  23. #endif
  24.  
  25. #ifndef FWTCOLL_H
  26. #include "FWTColl.h"
  27. #endif
  28.  
  29. #ifndef FWODTYPS_H
  30. #include "FWODTyps.h"
  31. #endif
  32.  
  33. //========================================================================================
  34. //    Forward Declarations
  35. //========================================================================================
  36.  
  37. class ODStorageUnit;
  38. class ODLink;
  39. class FW_CPresentation;
  40. class FW_CPart;
  41. class FW_CCloneInfo;
  42. class FW_CDataInterchange;
  43.  
  44. //========================================================================================
  45. //    class FW_CLinkDestination
  46. //========================================================================================
  47.  
  48. class FW_CLinkDestination : public FW_CLink
  49. {
  50.   public:
  51.     FW_CLinkDestination(Environment* ev, 
  52.                         ODLink* odLink, 
  53.                         ODLinkInfo* linkInfo, 
  54.                         FW_CPresentation* presentation);
  55.     virtual ~FW_CLinkDestination();
  56.     
  57.     virtual FW_Boolean    DoUpdateLink(Environment* ev, ODStorageUnit* linkContentSU, ODPasteAsResult* embedInfo) = 0;
  58.     virtual void        DoPropagateChanges(Environment* ev, ODUpdateID updateID);
  59.  
  60.     virtual void        LinkEstablished(Environment* ev);
  61.     virtual void        LinkUpdated(Environment* ev, ODUpdateID updateID);
  62.                         
  63.     virtual void        BreakLink(Environment* ev);
  64.     virtual void        RestoreLink(Environment* ev, FW_CPart* part);
  65.  
  66.     virtual void        DoExternalizeLink(Environment* ev, ODStorageUnit* storageUnit,
  67.                                           FW_CCloneInfo* cloneInfo) = 0;
  68.  
  69.     void                ExternalizeLink(Environment* ev, ODStorageUnit* storageUnit,
  70.                                         FW_CCloneInfo* cloneInfo);
  71.  
  72.     ODLink*             GetODLink(Environment* ev) const;
  73.     FW_Boolean            IsAutoUpdate(Environment* ev) const;
  74.  
  75.     FW_Boolean            IsRegistered(Environment* ev) const;
  76.     void                Register(Environment* ev, FW_CPart* itsPart);
  77.     void                Unregister(Environment* ev);
  78.                         
  79.     ODUpdateID            GetUpdateID(Environment* ev) const;
  80.     void                PrivEstablishLink(Environment* ev);
  81.     void                SavePasteAsSettings(Environment* ev, ODPasteAsResult& pasteAsResult);
  82.  
  83.   protected:
  84.     ODLink*                fODLink;
  85.     ODLinkInfo            fLinkInfo;
  86.     FW_CDataInterchange* fDataInterchange;
  87.     
  88.   private:
  89.     FW_Boolean            fRegistered;
  90.     FW_CPart*            fPart;
  91.     FW_Boolean            fEstablished;
  92.     
  93. //-- Additional settings from the Paste As dialog
  94.     FW_Boolean            fEmbed;                // FALSE means Merge with Contents
  95.     ODPasteAsResult        fEmbedInfo;            // valid if fEmbed is true
  96. };
  97.  
  98. //========================================================================================
  99. //    Inlines
  100. //========================================================================================
  101.  
  102. //----------------------------------------------------------------------------------------
  103. //    FW_CLinkDestination::GetODLink
  104. //----------------------------------------------------------------------------------------
  105. inline ODLink* FW_CLinkDestination::GetODLink(Environment*) const
  106. {
  107.     return fODLink;
  108. }
  109.  
  110. //----------------------------------------------------------------------------------------
  111. //    FW_CLinkDestination::IsAutoUpdate
  112. //--------------------------------------------------------------------
  113. inline FW_Boolean FW_CLinkDestination::IsAutoUpdate(Environment*) const
  114. {
  115.     return fLinkInfo.autoUpdate;
  116. }
  117.  
  118. //----------------------------------------------------------------------------------------
  119. //    FW_CLinkDestination::IsRegistered
  120. //--------------------------------------------------------------------
  121. inline FW_Boolean FW_CLinkDestination::IsRegistered(Environment*) const
  122. {
  123.     return fRegistered;
  124. }
  125.  
  126. //----------------------------------------------------------------------------------------
  127. //    FW_CLinkDestination::GetUpdateID
  128. //--------------------------------------------------------------------
  129. inline ODUpdateID FW_CLinkDestination::GetUpdateID(Environment*) const
  130. {
  131.     return fLinkInfo.change;
  132. }
  133.  
  134.  
  135. #endif
  136.